package com.nowcoder.community.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;
import java.io.File;

/**
 * @author cjh
 * @date 2023/2/13 - 10:42
 */
@Configuration
@Slf4j
public class WKConfig {
    @Value("${wk.image.storage}")
    private String wkImageStorage;
    @PostConstruct
    public void Init(){
//      创建WK图片目录
        File file = new File(wkImageStorage);
        if (!file.exists()){
            file.mkdir();
            log.info("创建WK图片目录： "+wkImageStorage);
        }
    }
}
